package com.biscuit.page.basicservice.model.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author biscuit
 * @createTime 2024/7/12 9:53
 */
@Getter
public enum FileWorkTypePrefixEnum {

    PREFIX_AVATAR(1, "/avatar", "头像前缀");

    private final int type;
    private final String prefix;
    private final String desc;

    FileWorkTypePrefixEnum(int type, String prefix, String desc) {
        this.type = type;
        this.prefix = prefix;
        this.desc = desc;
    }

    public static FileWorkTypePrefixEnum getTypeEnumByType(Integer type) {
        return Arrays.stream(FileWorkTypePrefixEnum.values())
                .filter(x -> x.type == type).findFirst().orElse(null);
    }

}
